<template>
   <el-table :data="articleLists">
      <el-table-column prop="title" label="文章标题" style="text-color:green"></el-table-column>
      <el-table-column fixed="right" label="操作" width="180">
        <template slot-scope="scope">
          <el-button
            type="text"
            size="small"
           @click="$router.push(`/forums/detail/${scope.row._id}`)"
            >查看</el-button
          >
          <el-button type="text" size="small"
          
            >收藏</el-button
          >
        </template>
      </el-table-column>
    </el-table>
</template>
<script>
export default {
  data() {
    return {
      articleLists: [],
    };
  },
  methods: {
    async fetchArticles() {
      const res = await this.$http.get("/getArticles");
      console.log(res);
      this.articleLists = res;
     
    },
    fetch() {
      //
      this.fetchArticles();
    },
  },

  created() {
    this.fetch();
  },
};
</script>